package com.ailink.spring;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.FactoryBean;
import org.springframework.beans.factory.SmartFactoryBean;
import org.springframework.stereotype.Component;

@Slf4j
@Component
public class MyFactoryBean implements FactoryBean<Object>, SmartFactoryBean<Object> {

    public MyFactoryBean() {
        log.info("MyFactoryBean");
    }

    @Override
    public Object getObject() throws Exception {
        return new Object();
    }

    @Override
    public Class<?> getObjectType() {
        return Object.class;
    }

    @Override
    public boolean isEagerInit() {
        return true;
    }
}
